home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / AppleScript.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  5.7 KB  |  197 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleScript.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT AppleScript;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __APPLESCRIPT__}
  27. {$SETC __APPLESCRIPT__ := 1}
  28.  
  29. {$I+}
  30. {$SETC AppleScriptIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __ERRORS__}
  35. {$I Errors.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$IFC UNDEFINED __APPLEEVENTS__}
  40. {$I AppleEvents.p}
  41. {$ENDC}
  42. {    Types.p                                                        }
  43. {    Memory.p                                                    }
  44. {        MixedMode.p                                                }
  45. {    OSUtils.p                                                    }
  46. {    Events.p                                                    }
  47. {        Quickdraw.p                                                }
  48. {            QuickdrawText.p                                        }
  49. {    EPPC.p                                                        }
  50. {        PPCToolbox.p                                            }
  51. {            AppleTalk.p                                            }
  52. {        Processes.p                                                }
  53. {            Files.p                                                }
  54. {    Notification.p                                                }
  55.  
  56. {$IFC UNDEFINED __OSA__}
  57. {$I OSA.p}
  58. {$ENDC}
  59. {    AEObjects.p                                                    }
  60. {    Components.p                                                }
  61.  
  62. {$IFC UNDEFINED __TEXTEDIT__}
  63. {$I TextEdit.p}
  64. {$ENDC}
  65.  
  66. {$PUSH}
  67. {$ALIGN MAC68K}
  68. {$LibExport+}
  69.  
  70. CONST
  71.     typeAppleScript                = 'ascr';
  72.     kAppleScriptSubtype            = typeAppleScript;
  73.     typeASStorage                = typeAppleScript;
  74.  
  75. {*************************************************************************
  76.     Component Selectors
  77. *************************************************************************}
  78.     kASSelectInit                = $1001;
  79.     kASSelectSetSourceStyles    = $1002;
  80.     kASSelectGetSourceStyles    = $1003;
  81.     kASSelectGetSourceStyleNames = $1004;
  82.  
  83. {*************************************************************************
  84.     OSAGetScriptInfo Selectors
  85. *************************************************************************}
  86.     kASHasOpenHandler            = 'hsod';
  87.  
  88. {
  89.         This selector is used to query a context as to whether it contains
  90.         a handler for the kAEOpenDocuments event. This allows "applets" to be 
  91.         distinguished from "droplets."  OSAGetScriptInfo returns false if
  92.         there is no kAEOpenDocuments handler, and returns the error value 
  93.         errOSAInvalidAccess if the input is not a context.
  94.     }
  95. {*************************************************************************
  96.     Initialization
  97. *************************************************************************}
  98.  
  99. FUNCTION ASInit(scriptingComponent: ComponentInstance; modeFlags: LONGINT; minStackSize: LONGINT; preferredStackSize: LONGINT; maxStackSize: LONGINT; minHeapSize: LONGINT; preferredHeapSize: LONGINT; maxHeapSize: LONGINT): OSAError;
  100.     {$IFC NOT GENERATINGCFM}
  101.     INLINE $2F3C, $1C, $1001, $7000, $A82A;
  102.     {$ENDC}
  103. {
  104.         ComponentCallNow(kASSelectInit, 28);
  105.         This call can be used to explicitly initialize AppleScript.  If it is
  106.         not called, the a scripting size resource is looked for and used. If
  107.         there is no scripting size resource, then the constants listed below
  108.         are used.  If at any stage (the init call, the size resource, the 
  109.         defaults) any of these parameters are zero, then parameters from the
  110.         next stage are used.  ModeFlags are not currently used.
  111.         Errors:
  112.         errOSASystemError        initialization failed
  113.     }
  114. {
  115.     These values will be used if ASInit is not called explicitly, or if any
  116.     of ASInit's parameters are zero:
  117. }
  118.  
  119. CONST
  120.     kASDefaultMinStackSize        = 4 * 1024;
  121.     kASDefaultPreferredStackSize = 16 * 1024;
  122.     kASDefaultMaxStackSize        = 16 * 1024;
  123.     kASDefaultMinHeapSize        = 4 * 1024;
  124.     kASDefaultPreferredHeapSize    = 16 * 1024;
  125.     kASDefaultMaxHeapSize        = 32 * 1024 * 1024;
  126.  
  127. {*************************************************************************
  128.     Source Styles
  129. *************************************************************************}
  130.  
  131. FUNCTION ASSetSourceStyles(scriptingComponent: ComponentInstance; sourceStyles: STHandle): OSAError;
  132.     {$IFC NOT GENERATINGCFM}
  133.     INLINE $2F3C, $4, $1002, $7000, $A82A;
  134.     {$ENDC}
  135. {
  136.         ComponentCallNow(kASSelectSetSourceStyles, 4);
  137.         Errors:
  138.         errOSASystemError        operation failed
  139.     }
  140. FUNCTION ASGetSourceStyles(scriptingComponent: ComponentInstance; VAR resultingSourceStyles: STHandle): OSAError;
  141.     {$IFC NOT GENERATINGCFM}
  142.     INLINE $2F3C, $4, $1003, $7000, $A82A;
  143.     {$ENDC}
  144. {
  145.         ComponentCallNow(kASSelectGetSourceStyles, 4);
  146.         Errors:
  147.         errOSASystemError        operation failed
  148.     }
  149. FUNCTION ASGetSourceStyleNames(scriptingComponent: ComponentInstance; modeFlags: LONGINT; VAR resultingSourceStyleNamesList: AEDescList): OSAError;
  150.     {$IFC NOT GENERATINGCFM}
  151.     INLINE $2F3C, $8, $1004, $7000, $A82A;
  152.     {$ENDC}
  153. {
  154.         ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  155.         This call returns an AEList of styled text descriptors the names of the
  156.         source styles in the current dialect.  The order of the names corresponds
  157.         to the order of the source style constants, below.  The style of each
  158.         name is the same as the styles returned by ASGetSourceStyles.
  159.         
  160.         Errors:
  161.         errOSASystemError        operation failed
  162.     }
  163. {
  164.     Elements of STHandle correspond to following categories of tokens, and
  165.     accessed through following index constants:
  166. }
  167.  
  168. CONST
  169.     kASSourceStyleUncompiledText = 0;
  170.     kASSourceStyleNormalText    = 1;
  171.     kASSourceStyleLanguageKeyword = 2;
  172.     kASSourceStyleApplicationKeyword = 3;
  173.     kASSourceStyleComment        = 4;
  174.     kASSourceStyleLiteral        = 5;
  175.     kASSourceStyleUserSymbol    = 6;
  176.     kASSourceStyleObjectSpecifier = 7;
  177.     kASNumberOfSourceStyles        = 8;
  178.  
  179. { Gestalt selectors for AppleScript }
  180.     gestaltAppleScriptAttr        = 'ascr';
  181.     gestaltAppleScriptVersion    = 'ascv';
  182.  
  183.     gestaltAppleScriptPresent    = 0;
  184.     gestaltAppleScriptPowerPCSupport = 1;
  185.  
  186.  
  187. {$ALIGN RESET}
  188. {$POP}
  189.  
  190. {$SETC UsingIncludes := AppleScriptIncludes}
  191.  
  192. {$ENDC} {__APPLESCRIPT__}
  193.  
  194. {$IFC NOT UsingIncludes}
  195.  END.
  196. {$ENDC}
  197.